export default {
    getevaluate(state, seller){
        state.evaluate = seller
    },
    getgoods(state, goods){
        state.goods = goods
    },
    getmerchant(state, merchant){
        state.merchant = merchant
    },
    getshop(state,{food,v}){
        console.log(food,v)
        state.goods[food.idx].foods.forEach(element => {
            if(element.name===food.name){
                if(v){
                    element.count --
                }else{
                    element.count ++
                }
            }
        });
    },
    clearbtn(state) {
        state.goods.forEach((good) => {
          good.foods.forEach((food) => {
            if (food.count && food.count > 0) food.count = 0;
          });
        });
      },
}